/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package br.com.evl.tecinfo.gui;

import javax.swing.JOptionPane;

/**
 *
 * @author Jalisson
 */
public class Relatorio extends javax.swing.JFrame {

    private int clicou_ok;

    /**
     * Creates new form Relatorio
     */
    public Relatorio() {
        initComponents();
        setSize(1050, 650);
        setLocationRelativeTo(this);
        setTitle("RELATÓRIO");
    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jLabelRegistroHoras = new javax.swing.JLabel();
        jButton_cancelarHorasExtras1 = new javax.swing.JButton();
        jButton_listarfuncionarioshoraextra = new javax.swing.JButton();
        jButton_IMRPIMIRHorasExtras = new javax.swing.JButton();
        jComboBox_meshoraextra = new javax.swing.JComboBox();
        jComboBoxano_horaextra = new javax.swing.JComboBox();
        jComboBoxpagamento_horaextra1 = new javax.swing.JComboBox();
        jScrollPane1 = new javax.swing.JScrollPane();
        jTablehoraextra = new javax.swing.JTable();
        jLabelIMGRegsitroHoras = new javax.swing.JLabel();
        jLabelIMGLogoRelatorio = new javax.swing.JLabel();
        jLabelIMGbg = new javax.swing.JLabel();

        setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
        getContentPane().setLayout(null);

        jLabelRegistroHoras.setFont(new java.awt.Font("Century Gothic", 0, 18)); // NOI18N
        jLabelRegistroHoras.setForeground(new java.awt.Color(102, 102, 102));
        jLabelRegistroHoras.setText("RELATÓRIO");
        getContentPane().add(jLabelRegistroHoras);
        jLabelRegistroHoras.setBounds(490, 30, 130, 40);

        jButton_cancelarHorasExtras1.setFont(new java.awt.Font("Century Gothic", 0, 12)); // NOI18N
        jButton_cancelarHorasExtras1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/br/com/evl/tecinfo/gui/imagens/sair20x20.png"))); // NOI18N
        jButton_cancelarHorasExtras1.setText("SAIR");
        jButton_cancelarHorasExtras1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton_cancelarHorasExtras1ActionPerformed(evt);
            }
        });
        getContentPane().add(jButton_cancelarHorasExtras1);
        jButton_cancelarHorasExtras1.setBounds(920, 110, 90, 30);

        jButton_listarfuncionarioshoraextra.setFont(new java.awt.Font("Century Gothic", 0, 12)); // NOI18N
        jButton_listarfuncionarioshoraextra.setIcon(new javax.swing.ImageIcon(getClass().getResource("/br/com/evl/tecinfo/gui/imagens/pesquisarrelatorio20x20.png"))); // NOI18N
        jButton_listarfuncionarioshoraextra.setText("LISTAR");
        jButton_listarfuncionarioshoraextra.setEnabled(false);
        jButton_listarfuncionarioshoraextra.setHorizontalAlignment(javax.swing.SwingConstants.LEFT);
        jButton_listarfuncionarioshoraextra.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton_listarfuncionarioshoraextraActionPerformed(evt);
            }
        });
        getContentPane().add(jButton_listarfuncionarioshoraextra);
        jButton_listarfuncionarioshoraextra.setBounds(360, 110, 100, 30);

        jButton_IMRPIMIRHorasExtras.setFont(new java.awt.Font("Century Gothic", 0, 12)); // NOI18N
        jButton_IMRPIMIRHorasExtras.setIcon(new javax.swing.ImageIcon(getClass().getResource("/br/com/evl/tecinfo/gui/imagens/imprimir20x20.png"))); // NOI18N
        jButton_IMRPIMIRHorasExtras.setText("IMPRIMIR");
        jButton_IMRPIMIRHorasExtras.setEnabled(false);
        jButton_IMRPIMIRHorasExtras.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton_IMRPIMIRHorasExtrasActionPerformed(evt);
            }
        });
        getContentPane().add(jButton_IMRPIMIRHorasExtras);
        jButton_IMRPIMIRHorasExtras.setBounds(470, 110, 150, 30);

        jComboBox_meshoraextra.setFont(new java.awt.Font("Century Gothic", 0, 12)); // NOI18N
        jComboBox_meshoraextra.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Mês:", "Janeiro", "Fevereiro", "Março ", "Abril", "Maio", "Junho", "Julho", "Agosto", "Setembro", "Outubro", "Novembro", "Dezembro" }));
        jComboBox_meshoraextra.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jComboBox_meshoraextraActionPerformed(evt);
            }
        });
        getContentPane().add(jComboBox_meshoraextra);
        jComboBox_meshoraextra.setBounds(20, 110, 91, 30);

        jComboBoxano_horaextra.setFont(new java.awt.Font("Century Gothic", 0, 12)); // NOI18N
        jComboBoxano_horaextra.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Ano", "2013", "2014", "2015", "2016", "2017" }));
        jComboBoxano_horaextra.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jComboBoxano_horaextraActionPerformed(evt);
            }
        });
        getContentPane().add(jComboBoxano_horaextra);
        jComboBoxano_horaextra.setBounds(120, 110, 91, 30);

        jComboBoxpagamento_horaextra1.setFont(new java.awt.Font("Century Gothic", 0, 12)); // NOI18N
        jComboBoxpagamento_horaextra1.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Pagamento", "Cheque", "Deposito", "Dinherio" }));
        jComboBoxpagamento_horaextra1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jComboBoxpagamento_horaextra1ActionPerformed(evt);
            }
        });
        getContentPane().add(jComboBoxpagamento_horaextra1);
        jComboBoxpagamento_horaextra1.setBounds(220, 110, 120, 30);

        jTablehoraextra.setFont(new java.awt.Font("Century Gothic", 0, 12)); // NOI18N
        jTablehoraextra.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {

            },
            new String [] {
                "Funcionário", "Atividades", "R$ H/A", "H/A mês", "B/H mês", "Outros", "Total", "Mês", "Ano", "Nº da Conta", "Angência"
            }
        ) {
            Class[] types = new Class [] {
                java.lang.String.class, java.lang.String.class, java.lang.Integer.class, java.lang.Double.class, java.lang.Double.class, java.lang.Double.class, java.lang.Double.class, java.lang.Object.class, java.lang.Object.class, java.lang.Object.class, java.lang.Object.class
            };
            boolean[] canEdit = new boolean [] {
                false, false, false, false, false, false, false, false, false, false, false
            };

            public Class getColumnClass(int columnIndex) {
                return types [columnIndex];
            }

            public boolean isCellEditable(int rowIndex, int columnIndex) {
                return canEdit [columnIndex];
            }
        });
        jTablehoraextra.setEnabled(false);
        jScrollPane1.setViewportView(jTablehoraextra);

        getContentPane().add(jScrollPane1);
        jScrollPane1.setBounds(20, 159, 991, 420);

        jLabelIMGRegsitroHoras.setIcon(new javax.swing.ImageIcon(getClass().getResource("/br/com/evl/tecinfo/gui/imagens/usuario.png"))); // NOI18N
        getContentPane().add(jLabelIMGRegsitroHoras);
        jLabelIMGRegsitroHoras.setBounds(460, 30, 160, 40);

        jLabelIMGLogoRelatorio.setIcon(new javax.swing.ImageIcon(getClass().getResource("/br/com/evl/tecinfo/gui/imagens/RELATORIO.png"))); // NOI18N
        getContentPane().add(jLabelIMGLogoRelatorio);
        jLabelIMGLogoRelatorio.setBounds(30, 20, 64, 64);

        jLabelIMGbg.setForeground(new java.awt.Color(255, 255, 255));
        jLabelIMGbg.setIcon(new javax.swing.ImageIcon(getClass().getResource("/br/com/evl/tecinfo/gui/imagens/backgroud.jpg"))); // NOI18N
        getContentPane().add(jLabelIMGbg);
        jLabelIMGbg.setBounds(0, 0, 1040, 650);

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void jButton_listarfuncionarioshoraextraActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton_listarfuncionarioshoraextraActionPerformed
        jButton_IMRPIMIRHorasExtras.setEnabled(true);
    }//GEN-LAST:event_jButton_listarfuncionarioshoraextraActionPerformed

    private void jComboBoxano_horaextraActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jComboBoxano_horaextraActionPerformed
        //CONDIÇÃO PARA NÃO PERMITIR LISTAR ENQUANTO NÃO SELECIONAR MÊS E ANO E PAGAMENTO
        if (jComboBox_meshoraextra.getSelectedIndex() != 0 && jComboBoxano_horaextra.getSelectedIndex() != 0
                && jComboBoxpagamento_horaextra1.getSelectedIndex() != 0) {
            jButton_listarfuncionarioshoraextra.setEnabled(true);
        } else {
            jButton_listarfuncionarioshoraextra.setEnabled(false);
        }
    }//GEN-LAST:event_jComboBoxano_horaextraActionPerformed

    private void jButton_IMRPIMIRHorasExtrasActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton_IMRPIMIRHorasExtrasActionPerformed
        
    }//GEN-LAST:event_jButton_IMRPIMIRHorasExtrasActionPerformed

    private void jButton_cancelarHorasExtras1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton_cancelarHorasExtras1ActionPerformed
        // TODO add your handling code here:
        java.awt.Toolkit.getDefaultToolkit().beep();
        clicou_ok = JOptionPane.showConfirmDialog(null, "Deseja realmente sair?", "Confirmação", JOptionPane.YES_NO_OPTION);
        if (clicou_ok == JOptionPane.YES_OPTION) {
            this.dispose();
        } else if (clicou_ok == JOptionPane.NO_OPTION) {
        }
    }//GEN-LAST:event_jButton_cancelarHorasExtras1ActionPerformed

    private void jComboBoxpagamento_horaextra1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jComboBoxpagamento_horaextra1ActionPerformed
        //CONDIÇÃO PARA NÃO PERMITIR LISTAR ENQUANTO NÃO SELECIONAR MÊS E ANO E PAGAMENTO
        if (jComboBox_meshoraextra.getSelectedIndex() != 0 && jComboBoxano_horaextra.getSelectedIndex() != 0
                && jComboBoxpagamento_horaextra1.getSelectedIndex() != 0) {
            jButton_listarfuncionarioshoraextra.setEnabled(true);
        } else {
            jButton_listarfuncionarioshoraextra.setEnabled(false);
        }
    }//GEN-LAST:event_jComboBoxpagamento_horaextra1ActionPerformed

    private void jComboBox_meshoraextraActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jComboBox_meshoraextraActionPerformed
        //CONDIÇÃO PARA NÃO PERMITIR LISTAR ENQUANTO NÃO SELECIONAR MÊS E ANO E PAGAMENTO
        if (jComboBox_meshoraextra.getSelectedIndex() != 0 && jComboBoxano_horaextra.getSelectedIndex() != 0
                && jComboBoxpagamento_horaextra1.getSelectedIndex() != 0) {
            jButton_listarfuncionarioshoraextra.setEnabled(true);
        } else {
            jButton_listarfuncionarioshoraextra.setEnabled(false);
        }
    }//GEN-LAST:event_jComboBox_meshoraextraActionPerformed
    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        /* Set the Nimbus look and feel */
        //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
        /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
         * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html 
         */
        try {
            for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
                if ("Nimbus".equals(info.getName())) {
                    javax.swing.UIManager.setLookAndFeel(info.getClassName());
                    break;


                }
            }
        } catch (ClassNotFoundException ex) {
            java.util.logging.Logger.getLogger(Relatorio.class
                    .getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (InstantiationException ex) {
            java.util.logging.Logger.getLogger(Relatorio.class
                    .getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (IllegalAccessException ex) {
            java.util.logging.Logger.getLogger(Relatorio.class
                    .getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (javax.swing.UnsupportedLookAndFeelException ex) {
            java.util.logging.Logger.getLogger(Relatorio.class
                    .getName()).log(java.util.logging.Level.SEVERE, null, ex);
        }
        //</editor-fold>

        /* Create and display the form */
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                new Relatorio().setVisible(true);
            }
        });
    }
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton jButton_IMRPIMIRHorasExtras;
    private javax.swing.JButton jButton_cancelarHorasExtras1;
    private javax.swing.JButton jButton_listarfuncionarioshoraextra;
    private javax.swing.JComboBox jComboBox_meshoraextra;
    private javax.swing.JComboBox jComboBoxano_horaextra;
    private javax.swing.JComboBox jComboBoxpagamento_horaextra1;
    private javax.swing.JLabel jLabelIMGLogoRelatorio;
    private javax.swing.JLabel jLabelIMGRegsitroHoras;
    private javax.swing.JLabel jLabelIMGbg;
    private javax.swing.JLabel jLabelRegistroHoras;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JTable jTablehoraextra;
    // End of variables declaration//GEN-END:variables
}
